/*
 * <Pezad Platformer>
 * Copyright 2008 Shayne Riley
 * 
 * This file is part of <Pezad Platformer>.
 * 
 * <Pezad Platformer> is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * <Pezad Platformer> is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with <Pezad Platformer>.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * To contact the authors on questions or issues regarding the license,
 * you may send an email to <shayner@gmail.com> or write to
 * Shayne Riley / P.O. Box 1092 / McCook, NE 69001.
 */

#ifndef IMAGESDL_H_
#define IMAGESDL_H_

#include "Image.h"
#include <SDL/SDL.h> 

namespace pzdDisplay
{

//! Uses SDL for all raster functionality.
class ImageSDL : public Image
{
public:
    //! Constructor for ImageSDL.
	/**
	 * @param surface	The SDL_Surface to assume control of. Because the
	 * 		passed-in surface will be controlled by this class, do not call
	 * 		SDL_FreeSurface, as that will cause this class to contain an
	 * 		invalid surface.
	 */
	ImageSDL(SDL_Surface *surface);

	//! Retrieve the horizontal length of the image in pixels.
    virtual int getWidth() const;

    //! Retrieve the vertical length of the image in pixels.
    virtual int getHeight() const;

    //! Retrieve the surface which contains the data of the image.
    SDL_Surface * getSurface() const;

    //! Destructor
    virtual ~ImageSDL();
    
private:

//    //! No assignment needed. Do not define this function.
//    ImageSDL& operator=(const ImageSDL rhs);
	//! Do not define copy constructor.
    ImageSDL(const ImageSDL& rhs);
//    //! No address-of needed. Do not define this function.
//    ImageSDL* operator&();
//    //! No const address-of needed. Do not define this function.
//    const ImageSDL* operator&() const;

    //! Checks the source Surface to make sure it is ImageSDL worthy.
    SDL_Surface* initSurface(SDL_Surface *src);

// If ImageSDL is immutable, then this might not be needed. But should it
// be immutable?
//    //! Copies the SDL_Surface from src.
//    SDL_Surface* initSurface(SDL_Surface *src);
//
//    //! Makes sure that the source surface can be copied.
//    bool copiableSurface(SDL_Surface *src);

    // Variables
    /**
     * Contains raster, dimension, and image type data.
     * Even though this is const, parts of the surface can still be changed,
     * but it should best be avoided. This is initialized by initSurface.
     */
    SDL_Surface *mSurface;
};

} // namespace

#endif /*IMAGESDL_H_*/
